<?php
	
	/**
	 * JsMin Generator File.
	 * 
	 * @author Brian Bal <brian@youbeqb.com>
	 * @version 1.0
	 * @package MVC
	 */
	
	/**
	 * JsMin Generator class
	 *
	 * @package MVC
	 * @author Brian Bal
	 **/
	
	Class JsMinGenerator extends BaseGenerator
	{		
		public function generate($params)
		{
			if(isset($params[2]))
			{
				$min_js = get_min_javascript($params[2]);
				$file_name = $this->javascriptDir() . $params[2] . ".min";
				$file_name = str_replace(".js", "", $file_name) . ".js";
				
				$this->writeFile($file_name, $min_js);
			}else{
				printUsage();
			}
		}
	}
	